from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired
from config import Config
import code2vec

class NameForm(FlaskForm):
    name = StringField('What is your name?', validators=[DataRequired()])
    submit = SubmitField('Submit')

    def runDL(self):


        train_data ="F:\博士\看的论文\data\code2vec\java-small\java-small.train.c2v"
        test_data ="F:\博士\看的论文\data\code2vec\java-small\java-small.test.c2v"
        model_dir = "./models/java-small"

        config = Config(set_defaults=True, load_from_args=True, verify=True)
        parser = config.arguments_parser()
        parser.parse_args(["-d",train_data,"--test",test_data,"--save",model_dir])

        code2vec.run(config)

